package cn.qn.mapper.user;

import cn.qn.dto.user.AppUserScoreDTO;
import cn.qn.dto.user.AppUserScoreQueryDTO;
import cn.qn.moudle.user.AppUserScore;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: Bryant
 * @date: 2019/5/29
 * @description:
 */
@Mapper
public interface AppUserScoreMapper {
    /**
     * 分页查询App用户积分列表
     *
     * @param query
     * @param pb
     * @return
     */
    List<AppUserScoreDTO> pageQueryAppUserScores(AppUserScoreQueryDTO query, PageBounds pb);

    /**
     * 分页查询App用户积分
     *
     * @param query
     * @return
     */
    Integer pageQueryAppUserScoresCount(AppUserScoreQueryDTO query);

    /**
     * 查询会员最新一条积分领取记录
     * @param userId
     * @return
     */
    AppUserScore findLastOneByUserId(@Param(value = "userId") String userId);

    /**
     * 查询会员最近一周的积分领取记录
     * @param userId
     * @return
     */
    List<AppUserScore> findOneWeekByUserId(@Param(value = "userId") String userId);
}
